<?php
$this->breadcrumbs=array(
	'Roles'=>array('admin'),
	'Administrar',
);

$this->menu=array(
	array('label'=>'Listar Roles', 'url'=>array('admin')),
	array('label'=>'Crear Rol', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('troles-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Administrar Roles</h1>


<?php echo CHtml::link('Busqueda Avanzada','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'troles-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
	'columns'=>array(
		'idroles',
		'descripcion',
		array(
			'class'=>'CButtonColumn',
			'buttons'=>array(
				'delete'=>array(
						'visible'=>'false'
					),
				'update'=>array(
						'visible'=>'false'
					),
			),
		),
	),
)); ?>
